home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / GRAPHICS.SWG / 0035_Writing to Graphic Pages.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-02  |  1KB  |  45 lines

  1. {
  2. RANDY PARKER
  3.  
  4.     I've been playing With using the Absolute address $A000:0000 to do direct
  5. video Writes in Graphics mode and was wondering if someone could tell me how
  6. to get colors.  I use an Array of [1..NumOfBits].  NumOfBits being the number
  7. of bits the current Graphic page Uses when it stores it's information.
  8.  
  9. The following is an example of what I mean:
  10. }
  11.  
  12. Program UseFastGraf;
  13. Uses
  14.   Graph;
  15.  
  16. Type
  17.   View = Array [1..19200] of Word;
  18.  
  19. Var
  20.   I,
  21.   GraphDriver,
  22.   GraphMode    : Integer;
  23.   View1        : View Absolute $A000:0000;
  24.   View2        : View;
  25.  
  26. begin
  27.   GraphDriver := Detect;
  28.   InitGraph(GraphDriver, GraphMode, 'e:\bp\bgi');
  29.   For I := 1 to 1000 Do
  30.   begin
  31.     SetColor(Random(GetMaxColor));
  32.     Line(Random(GetMaxX), Random(GetMaxY), Random(GetMaxX), GetMaxY);
  33.   end;
  34.   View2 := View1;
  35.   SetColor(15);
  36.   OutTextXY(100, 100, 'Press Enter To Continue : ');
  37.   Readln;
  38.   ClearDevice;
  39.   OutTextXY(100, 100, 'Press Enter To See The Previous Screen');
  40.   Readln;
  41.   View1 := View2;
  42.   Readln;
  43. end.
  44.  
  45.